Ext.define('DutyList.calendar.data.User', {
    extend: 'Ext.data.Model',

    requires: [
        'Ext.data.proxy.Memory',
        'Ext.data.reader.Json',
        'Ext.data.writer.Json'
    ],
    fields : [
        'i_user', 'name','id_group',
        'active', 'login', 'surname',
		'registration_date',
        'status', 'email',
        'role', 'password'
    ],
    autoLoad:true,
    proxy:{
        type:'ajax',
		url: "src/data/usersJS.json" ,
        reader:{
            type:'json',
            root:'users',
            successProperty:'success'
        }
    },
    /*proxy: {
        type: 'ajax',
        url : '/users',
        reader: {
            type: 'json',
            root: 'users',
            successProperty: 'success'
        }
    },*/
    associations: [{
        type: 'belongsTo',
        model: 'DutyList.calendar.data.Group',
        name: 'groups',
        foreignKey: 'id_group',
        primaryKey: 'i_group',
        autoLoad: true
    }]
});
